﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<UserEntity>" %>
<%@ Import Namespace="MvcForum.Net.Configuration" %>
<div class="fr-widget">
    <div class="header">
        <div class="icon">
        </div>
        <span>Chỉnh sửa hình đại diện</span>
    </div>
    <%using (Html.BeginForm("UpdateAvatar", "CPanel", FormMethod.Post, new { @id = "AvatarF", @onRequest = "$.MvcForum.showLoading()", @onSuccess = "$.MvcForum.hideLoading();$.MvcForum.ajaxSuccess(msg)" }))
      {

%>
    <%=Html.AntiForgeryTokenX("UPDATE_AVATAR")%>
    <table cellpadding="0" cellspacing="1" width="100%">
        <tr>
            <td colspan="2" class="table-caption">
                <%=string.Format(ForumContext.GetText("AVATAR", "AVATAR_SIZE_AND_TYPES"),
                                          ForumContext.Configuration.AvatarWidth,
                                          ForumContext.Configuration.AvatarHeight)%>
            </td>
        </tr>
        <tr>
            <td colspan="2" class="table-cell">
                <%=ForumContext.GetText("AVATAR", "DESCRIPTION")%>
            </td>
        </tr>
        <tr>
            <td colspan="2" class="table-caption">
                <%=ForumContext.GetText("AVATAR", "CURRENT_AVATAR")%>
            </td>
        </tr>
        <tr>
            <td class="table-cell w50">
                <%=ForumContext.GetText("AVATAR", "YOUR_AVATAR")%>
            </td>
            <td class="table-cell">
                <%=!string.IsNullOrEmpty(Model.Avatar)
                                ? string.Format(
                                    "<img src=\"{0}\" style=\"width:{1}px;height:{2}px\" />",
                                    Model.Avatar,
                                    ForumConfiguration.Instance.AvatarWidth, ForumConfiguration.Instance.AvatarHeight)
                                : ForumContext.GetText("AVATAR", "NO_AVATAR")%>
            </td>
        </tr>
        <tr>
            <td class="table-cell">
                <%=ForumContext.GetText("AVATAR", "REMOTE_URL")%>
            </td>
            <td class="table-cell">
                <input type="text" class="input {validate:{url:true}}" id="RemoteUrl" name="RemoteUrl" />
            </td>
        </tr>
        <tr>
            <td class="table-cell">
                &nbsp;
            </td>
            <td class="table-cell">
                <input type="button" onclick="$.MvcForum.ajaxSubmit('AvatarF')" value="Cập nhật" />
            </td>
        </tr>
    </table>

    <%
      }%>
</div>
